package com.aierjun.ani.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.ContextCompat;

import com.aierjun.ani.R;
import com.yanzhenjie.album.Album;

import java.util.List;

import static android.app.Activity.RESULT_OK;

/**
 * Created by Ani_aierJun on 2017/10/19.
 */

public class ChoosePhotoUtils {

    public static void startIntent(Activity activity, int choosePhotoNum){
        Album.startAlbum(activity, 2
                , choosePhotoNum                                                        // 指定选择数量。
                , ContextCompat.getColor(activity, R.color.colorPrimary)        // 指定Toolbar的颜色。
                , ContextCompat.getColor(activity, R.color.colorPrimaryDark));  // 指定状态栏的颜色。
    }

    public static void superOnActivityResult(int requestCode, int resultCode, Intent data){
        try {
            if (resultCode == RESULT_OK) { // 判断是否成功。
                List<String> pathList = Album.parseResult(data);
                for (int i = 0; i < pathList.size(); i++) {

                }
            }
        } catch (Exception e) {
            System.out.println("请选择图片");
        }

    }
}
